always make the file we try to delete be read-write as required
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Fri, 4 Apr 2025 09:06:59 +0000 (11:06 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Mon, 7 Apr 2025 10:53:38 +0000 (10:53 +0000)
on windows you must only delete read-write files

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/common/filesystembase.cpp

index 90dea280ff6ade5ba019a87d4d584a47a7ca781e..ffcd4f36bfe0ff7e1c9d9402d1cfd889c965e4ac 100644 (file)
@@ -586,9 +586,7 @@ bool FileSystem::remove(const QString &fileName, QString *errorString)
 #ifdef Q_OS_WIN
     // You cannot delete a read-only file on windows, but we want to
     // allow that.
-    if (!isWritable(fileName)) {
-        setFileReadOnly(fileName, false);
-    }
+    setFileReadOnly(fileName, false);
 #endif
     QFile f(fileName);
     if (!f.remove()) {